package com.yzt.act.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yzt.act.entity.CommAssignee;
import com.yzt.act.service.ICommAssigneeService;
import com.yzt.base.kit.Base;

import io.swagger.annotations.Api;

/**
 * <p>
 * 全局流程审核办理人表 前端控制器
 * </p>
 *
 * @author Y
 * @since 2021-04-08
 */
@RestController
@RequestMapping("/act/commAssignee")
@Api("全局流程办理人")
public class CommAssigneeController {

	@Autowired
	private ICommAssigneeService commAssigneeService;

	@PostMapping("")
	public Base<Object> saveAssignee(CommAssignee assignee) {
		boolean save = commAssigneeService.save(assignee);
		if (save)
			return Base.ok();
		return Base.fail();
	}

	@GetMapping("getAssignee")
	public Base<CommAssignee> getAssignee(String did, String taskId) {
		CommAssignee assignee = commAssigneeService.getAssignee(did, taskId);
		if (assignee != null)
			return Base.okData(assignee);
		return Base.fail("未查询到数据");

	}

}
